<template>
  <div id="app">
    <button @click="getStudentsInfo">获取学生信息</button>
    <br><br>
    <button @click="getCarsInfo">获取汽车信息</button>
  </div>
</template>

<script>
import axios from "axios";

export default {
  name: 'App',
  components: {
  },
  data() {
    return {
    }
  },
  methods: {
    getStudentsInfo() {
      axios({
          method: 'GET',
          url: 'http://localhost:8080/5000/students'
      }).then(resp => {
        console.log("请求成功了！", resp.data);
      },err => {
        console.log("请求失败了！", err.message);
      });
    },
    getCarsInfo() {
      axios({
          method: 'GET',
          url: 'http://localhost:8080/5001/cars'
      }).then(resp => {
        console.log("请求成功了！", resp.data);
      },(err) => {
        console.log("请求失败了！", err.message);
      });
    }
  },
}
</script>

<style>
</style>
